/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

/**
 * <p>Project: javaseapp - Teacher
 * <p>Powered by webrx On 2021-08-31 08:55:04
 * <p>java.lang.Record 是record父类
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public record Teacher(int id, String name, int age, double money, String address) {
    int pf(int i) {
        return i * i;
    }

    public Teacher(int id, String name) {
        this(id, name, 19, 50, "郑州");
    }

    public Teacher {
        //相当于类的static程序段，用来初始化功能，每个构造方法执行前都要执行此代码段
        System.out.println("hello world record");
    }

    public Teacher(int id) {
        this(id, "佚名", 18, 500, "河南省郑州市");
        /*
        this.id = id;
        this.name = "jack";
        this.age = 18;
        this.money = 500;
        this.address = "河南省郑州";*/
    }

    public Teacher() {
        this(101, "佚名", 18, 500, "河南省郑州市");
    }


    public double money() {
        return money + 5;
    }
}

